

package com.hazelcast.cp.event;

import java.util.EventListener;

/**
 * CPMembershipListener is notified when a CP member is added to
 * or removed from the CP Subsystem.
 *
 * @see com.hazelcast.cp.CPSubsystemManagementService
 * @see com.hazelcast.cp.CPSubsystem#addMembershipListener(CPMembershipListener)
 * @since 4.1
 */
public interface CPMembershipListener extends EventListener {

    /**
     * Called when a new CP member is added to the CP Subsystem.
     *
     * @param event membership event
     */
    void memberAdded(CPMembershipEvent event);

    /**
     * Called when a CP member is removed from the CP Subsystem.
     *
     * @param event membership event
     */
    void memberRemoved(CPMembershipEvent event);
}
